<div id="wrap" class="activity_wrap">
	<div class="col-left">
		<div id="activity_brief_top">
			<p><?php echo $activity_location.' > '.$activity_category ?></p>
			<h2><?php echo $activity_title ?></h2>
			<span class="brief_ele"><?php echo $activity_duration.$this->lang->line($activity_duration_kind)?></span>
			<span class="brief_ele"><?php echo $activity_min_p.'-'.$activity_max_p.' '.$this->lang->line('people')?></span>
			<span class="brief_ele"><?php echo $this->lang->line('price_sign').$activity_price.$this->lang->line('price_kind')?></span>
		</div>
		<?php echo $image_show; ?>
		<div id="activity_brief_bottom">
			<ul>
				<li class="brief_ele_bottom"><?php echo $join_count.$this->lang->line('join_count') ?></li>
				<li class="brief_ele_bottom"><?php echo $this->lang->line('left').date('z',strtotime($activity_date)-strtotime('now')).$this->lang->line('days') ?></li>
				<li class="brief_ele_bottom"><?php
					if($join_count < $activity_min_p){
						echo $this->lang->line('not_on_go');
					}
					else{
						echo $this->lang->line('on_go');
					}
				?></li>
			</ul>
		</div>
		<div id="activity_tabs_container">
		    <ul id="tabs">
		    	<?php 
		    		$activity_page_tab = $this->config->item('activity_page_tab', 'layout');
					$tab_select = isset($tab_select)?$tab_select:'activity_desc_tab_content';
					foreach($activity_page_tab as $key=>$val){
						if($tab_select != $key){
							if($key=='relative_articles_content'){
								echo '<li><a href="#'.$key.'" onclick="getBlogResult(this,0,\''.$activity_title.'\');">'.$val.'</a></li>';
							}
							else{
								echo '<li><a href="#'.$key.'">'.$val.'</a></li>';
							}
						}
						else{
							if($key=='relative_articles_content'){
								echo '<li class=active><a href="#'.$key.'" onclick="getBlogResult(this,0,\''.$activity_title.'\');">'.$val.'</a></li>';
							}
							else{
								echo '<li class=active><a href="#'.$key.'">'.$val.'</a></li>';
							}	
						}
					}
		    	?>
		        
		    </ul>
		</div>
		<div id="activity_tabs_content_container">
		    <div id="activity_desc_tab_content" class="tab_content" <?php echo ($tab_select=='activity_desc_tab_content')?'style="display: block;"':'' ?> >
		        <?php
					echo $desc;
		        ?>
		    </div>
		    <div id="activity_comment_tab_content" class="tab_content" <?php echo ($tab_select=='favorite_tab_content')?'style="display: block;"':'' ?> >
		        <?php 
		        	//echo $activity_favorite;
				?>
				測試活動評價
		    </div>
		    <div id="relative_articles_content" class="tab_content" <?php echo ($tab_select=='relative_articles_content')?'style="display: block;"':'' ?> >
		        
		    </div>
		</div>
		<div id="fb-root"></div>
			<script>(function(d, s, id) {
			  var js, fjs = d.getElementsByTagName(s)[0];
			  if (d.getElementById(id)) return;
			  js = d.createElement(s); js.id = id;
			  js.src = "//connect.facebook.net/zh_TW/all.js#xfbml=1&appId=437667926289704";
			  fjs.parentNode.insertBefore(js, fjs);
			}(document, 'script', 'facebook-jssdk'));</script>
			<div class="fb-comments" data-href="<?php echo current_url();  ?>" data-num-posts="5" data-width="590"></div>	
	</div>
	<div class="sidebar">
		<div id="activity_action">
			<p class="left_count"><?php echo $this->lang->line('left').' <span>'.($activity_max_p-$join_count).'</span> '.$this->lang->line('quota_of_people'); ?></p>
			<input type="button" value="參加"/>
			<input type="button" value="收藏"/>
		</div>
		<div id="activity_comment">
			<div id="activity_comment_title">活動與描述相符</div>
			<div id="activity_comment_desc">
				<p id="score"><span>4.8</span>分</p>
				<p id="score_count">共902次評分</p>
			</div>
		</div>
		<div id="organizer_profile">
			<div id="organizer_profile_desc">
				<p id="organizer_avatar"><img width="220" height="220" src="/images/public/noavatar.gif"></p>
				<p id="organizer_name"><?php echo $username; ?></p>
				<p id="send_msg_to_organizer"><input type="button" value="傳訊息" onclick="sendMessageForm('<?php echo $email?>');" /></p>
			</div>
		</div>
		<?php if(count($activities['organizer']) > 1){
			?>
		<div id="activities_by_organizer">
			<div id="activities_by_organizer_title"><?php echo $this->lang->line('activities_by_organizer_title')?></div>
			<div id="activities_by_organizer_show">
				<?php
				foreach($activities['organizer'] as $act){
					if($act['status'] == '1' && $act['activity_id'] != $activity_id){ //published activity
						echo '<div class="activities_by_organizer_block">';
						if(isset($act['upload_image']) && !empty($act['upload_image'])){
							$temp_upload_image = json_decode($act['upload_image']);
							$show_thumb = 	$temp_upload_image[0];
							echo '<div class="activities_by_organizer_thumb"><img width="117" height="80" src = "'.$this->config->item('image_uploader_thumbs','layout').$id.'/'.$show_thumb.'"/></div>';
						}
						else{
							//empty_thumb_url
							echo '<div class="activities_by_organizer_thumb"><img width="117" height="80" src = "'.$this->config->item('empty_thumb_url','layout').'"/></div>';
						}
						echo '<div class="activities_title"><a href="'.$this->config->item('activity_url','layout').$act['activity_id'].'">'.$act['activity_title'].'</div>';	
						echo '</div>';
						
					}
				}
				?>
			</div>
		</div>
		<?php } ?>
	</div>
</div>